package no.sachmuld.methodcombination.examples.annotation.validate;

import no.sachmuld.methodcombination.api.MethodCombinationSupport;
import no.sachmuld.methodcombination.api.MethodInvocation;
import no.sachmuld.methodcombination.api.annotation.Default;
import no.sachmuld.methodcombination.api.annotation.MethodCombinationException;
import no.sachmuld.methodcombination.api.annotation.UsesMethodCombination;

/**
 *
 */
@UsesMethodCombination(FooBehaviour.class)
public class Foo extends MethodCombinationSupport<FooBehaviour> {

    public Foo() {
        with(new FooBehaviour() {
            @Override
            protected int bar(MethodInvocation<Integer> methodInvocation) {
                return 7;
            }
        });

    }

    @Default
    public final int bar() {
        throw new MethodCombinationException();
    }

}
